{include file="public/_header" /}
<div class="x-body">
    <form class="layui-form" method="post" enctype="multipart/form-data" action="/admin/banner/update">

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>共计发布广告
            </label>
            <div class="layui-input-inline">
                <input type="text" name="sum_share" required="" lay-verify="required"
                       autocomplete="off" class="layui-input" value="{$user.sum_share}" disabled>
            </div>
        </div>


        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>有效传播次数
            </label>
            <div class="layui-input-inline">
                <input type="text" name="valid_share" required="" lay-verify="required"
                       autocomplete="off" class="layui-input" value="10" value="{$user.valid_share}" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>次数</th>
                    <th>路径</th>
                </tr>
                </thead>
                <tbody class="tr-data">
                {volist name="user.spread_path" id="vo"}
                <tr>
                    <td>{$vo.sum_path}</td>
                    <td>{$vo.channel}</td>
                </tr>
                {/volist}
                </tbody>
            </table>
        </div>


    </form>
</div>

<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
                , layer = layui.layer;

        //自定义验证规则
        form.verify({
            nikename: function (value) {
                if (value.length < 5) {
                    return '昵称至少得5个字符啊';
                }
            }
            , pass: [/(.+){6,12}$/, '密码必须6到12位']
            , repass: function (value) {
                if ($('#L_pass').val() != $('#L_repass').val()) {
                    return '两次密码不一致';
                }
            }
        });

    });

    layui.use('laydate', function () {
        $ = layui.jquery;
        var laydate = layui.laydate;
        //日期时间范围
        laydate.render({
            elem: '#test10'
            , type: 'datetime'
            , range: true
        });
    });




</script>